package com.example.demo.shiro; 
 
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Component;

/**
 * SHIRO 权限标签
 * @author Administrator
 *
 */
@Component
public class ShiroSimpleTag {
    
	/**
	 * 是否拥有该权限
	 * @param permission
	 * @return
	 */
	public boolean HasPermission(String permission) {
		 Subject subject=SecurityUtils.getSubject();
		 return subject !=null && subject.isPermitted(permission);
	}
	
}
